/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gui.menu.classDiagram;

import data.DataVector;
import gui.menu.RibbonButton;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author SG0217432
 */
public class DeleteEntityItem extends RibbonButton implements ActionListener {

    public DeleteEntityItem() {
        super("icons/deleteEntity.png", "Delete", "Delete selected entity");

        addActionListener(this);
    }

    public void actionPerformed(ActionEvent e) {
        if (DataVector.getInstance().getActiveEntity()!= null) {
	        DataVector.getInstance().removeEntity(
			        DataVector.getInstance().getActiveEntity()
	        );
        }
    }

}
